mysql   = require("mysql");
events  = require("events")

pool = mysql.createPool {
    host        : 'localhost'
    user        : 'root'
    password    : 'password'
    database    : 'ace-test'
    debug       : true
}


exports.query = (sql, args, callback) ->
    pool.getConnection(err, connection) ->
        connection.query sql, args, (err, rows) ->
            callback(err, rows)

class Model extends events.EventEmitter

Model::init     = ->
    console.log """Not Finished"""

Model::byId     = ->
    console.log """Not Finished"""

Model::save     = ->
    console.log """Not Finished"""

Model::delete   = ->
    console.log """Not Finished"""

Model::query    =->
    console.log """Not Finished"""


new Model().query()


exports.Model = Model







